<template>
	<view class="flex-col page">
		<u-navbar :is-back="false" title-color="#FFFFFF" title="">
			<view class="slot-wrap">
				<image mode="aspectFit" style="padding-left: -20rpx;padding-top:20rpx;height: 59.4rpx;width: 369.6rpx;"
					:src="logo"></image>
			</view>
		</u-navbar>
		<view class="flex-col group">
			<view class="list">
				<view @click="toDetail(item)" class="list-item flex-col" :key="i" v-for="(item, i) in list">
					<view :style="{backgroundImage:`url(${item.index_img})`}" class="top-section flex-row">
						<view class="left-text-wrapper flex-col items-center">
							<text>优化前</text>
						</view>
						<view class="center-image-wrapper flex-col items-center">

						</view>
						<view class="right-text-wrapper flex-col items-center">
							<text>优化后</text>
						</view>
					</view>
					<view class="bottom-group justify-between">
						<text class="text_3">{{item.name}}</text>
						<view class="right-section flex-row">
							<text>点击前往</text>
							<u-icon name="arrow-right-double"></u-icon>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				logo: '/static/image/ai-image.png'
			};
		},
		onLoad() {
			this.getData();
		},
		onShow() {
			
		},
		onReady() {
			
		},
		onUnload() {
			
		},
		methods: {
			getData(){
				this.list = [
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "人物动漫化",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "加强版动漫人像",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "3D游戏人像",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "人物特效",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "智能变美",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "转换表情",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "改变发型",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "睁开眼睛",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "活照片",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "老照片修复",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "图像去雾",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "图像清晰度增强",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "拉伸图像恢复",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "图像趣味处理",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "图像无损放大",
						options: []
					},
					{
						after_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/3f3ee6e7-ed12-438a-8d8f-063088990fa8.jpg",
						before_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/a766d745-700a-4ff3-b514-f9afc35b23a0.jpg",
						index_img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-9225cf9c-812a-460f-a2e6-59b295dc56e4/e77d72f0-3f0a-45b8-860a-25982c1a6a64.png",
						name: "图像对比度增强",
						options: []
					},
				];
			},
			toDetail(item) {
				console.log(item);
				uni.navigateTo({
					url: "/pages/index/detail",
					success: (res) => {
						res.eventChannel.emit('acceptDataFromOpenerPage', item)
					}
				})
			}
		},
	};
</script>

<style lang="scss">
	
	html {
		font-size: 16px;
	}

	body {
		margin: 0;
		font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
			'Droid Sans', 'Helvetica Neue', 'Microsoft Yahei', sans-serif;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	view,
	image,
	text {
		box-sizing: border-box;
		flex-shrink: 0;
	}

	#app {
		width: 100vw;
		height: 100vh;
	}

	.flex-row {
		display: flex;
		flex-direction: row;
	}

	.flex-col {
		display: flex;
		flex-direction: column;
	}

	.justify-start {
		display: flex;
		justify-content: flex-start;
	}

	.justify-center {
		display: flex;
		justify-content: center;
	}

	.justify-end {
		display: flex;
		justify-content: flex-end;
	}

	.justify-evenly {
		display: flex;
		justify-content: space-evenly;
	}

	.justify-around {
		display: flex;
		justify-content: space-around;
	}

	.justify-between {
		display: flex;
		justify-content: space-between;
	}

	.items-start {
		display: flex;
		align-items: flex-start;
	}

	.items-center {
		display: flex;
		align-items: center;
	}

	.items-end {
		display: flex;
		align-items: flex-end;
	}

	.page {
		background-color: #f1f1f1;
		width: 100%;
		min-height: 100vh;
		overflow-y: auto;

		.group {
			padding: 32rpx 0 50rpx;
			flex: 1 1 auto;
			overflow-y: auto;

			.list {
				margin-left: 22rpx;
				margin-right: 18rpx;
				
				display: grid;
				grid-template-columns: repeat(2, 1fr);
				grid-row-gap: 32rpx;
				grid-column-gap: 22rpx;

				.list-item {
					background-color: rgb(255, 255, 255);
					box-shadow: 0px 0px 20rpx 0px rgba(0, 0, 0, 0.11);
					border-radius: 10rpx;
					position: relative;
					margin-top: 15rpx;
					margin-bottom: 15rpx;

					.top-section {
						color: rgb(255, 255, 255);
						font-size: 24rpx;
						line-height: 33rpx;
						white-space: nowrap;
						border-radius: 10rpx 10rpx 0px 0px;

						background-size: 100% 100%;
						background-repeat: no-repeat;

						.left-text-wrapper {
							padding: 8rpx 0 10rpx;
							flex: 1 1 106rpx;
							background-color: rgba(0, 0, 0, 0.3);
							border-radius: 10rpx 0px 10rpx 0px;
							height: 50rpx;
						}

						.center-image-wrapper {
							margin-left: 13rpx;
							flex: 1 1 106rpx;
							height: 186rpx;
							// .image {
							//   width: 14rpx;
							//   height: 186rpx;
							// }
						}

						.right-text-wrapper {
							margin-left: 14rpx;
							padding: 8rpx 0 10rpx;
							flex: 1 1 106rpx;
							background-color: rgba(0, 0, 0, 0.3);
							border-radius: 0px 10rpx 0px 10rpx;
							height: 50rpx;
						}
					}

					.bottom-group {
						padding: 20rpx 10rpx;

						.text_3 {
							margin-bottom: 3rpx;
							color: rgb(34, 34, 34);
							font-size: 28rpx;
							font-weight: 500;
							line-height: 33rpx;
							white-space: nowrap;
						}

						.right-section {
							padding: 4rpx 13rpx;
							color: rgb(255, 255, 255);
							font-size: 20rpx;
							line-height: 28rpx;
							white-space: nowrap;
							background-color: #fc587d;
							border-radius: 18rpx;
							height: 36rpx;

							.icon {
								margin: 7rpx 0 7rpx 6rpx;
								width: 8rpx;
								height: 14rpx;
							}
						}
					}
				}
			}
		}
	}
</style>
